<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <p>
            用户：
            <input type="text" v-model="data.name">
        </p>
        <p>
            密码：
            <input type="password" v-model="data.password" >
        </p>
        <button @click = "submit">登录</button>
        <button @click="reset">重置</button>
        <p>{{data}}</p>
    </div>
</body>
<script src="./vue.min.js"></script>
<script>
    new Vue({
        el:"#app",
        data:{
            data:{
                name:"",
                password:""
            }
        },
        methods: {
            submit(){
                console.log(this.data);
            },
            reset(){
                this.data.name = "";
                this.data.password = "";
            }
        },
    })
</script>
</html>